<?php

// +----------------------------------------------------------------------
// |  模型
// +----------------------------------------------------------------------
// | @author fancsen
// +----------------------------------------------------------------------

namespace app\api\model;

use app\api\model\BaseModel;

class ThirdApp extends BaseModel
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'third_app';
    //自动时间戳
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    //protected $createTime = 'create_at';
    protected $updateTime = 'update_time';
    protected $deleteTime = 'delete_time';
    //隐藏字段
    protected $hidden = ['delete_time','update_time'];

    /**
     * 检查指定app是否存在
     */
    public static function check($ac,$se)
    {
        $app = self::where('app_id','=',$ac)
            ->where('app_secret', '=',md5($se))
            ->find();
        return $app;
    }
}
